#include <bits/stdc++.h>
using namespace std;
const int maxn = (1<<16)+10;
int a[maxn], X[maxn];

int query(const string & s, int i, int j){
    cout << s << ' ' << i << ' ' << j << endl;
    int t; cin >> t;
    return t;
}

int main() {
    ios::sync_with_stdio(false);cin.tie(nullptr);
    int n; cin >> n;
    map<int, int> m;
    m[0] = 1;
    int j = 0, k = 0;
    for (int i = 2; i <= n; ++i) {
        X[i] = query("XOR", 1, i);
        if(m.count(X[i])){
            j = m[X[i]];
            k = i;
        }else
            m[X[i]] = i;
    }
    if(j){
        a[j] = query("AND", j, k);
        a[1] = X[j] ^ a[j];
    }
    else{
        for(j = 2; j<=n; ++j)
            for (k = j+1; k <= n; ++k)
                if((X[j] ^ X[k]) == n-1) goto nex;

        nex:
        int x, y, z, t;
        t = query("AND", 1, j);
        x = X[j] + 2*t;

        t = query("AND", 1, k);
        y = X[k] + 2*t;

        int xorjk = X[j] ^ X[k];
        t = 0;
        z = xorjk + 2*t;

        a[1] = (x+y-z)/2;
    }

    for (int i = 2; i <= n; ++i) {
        a[i] = a[1] ^ X[i];
    }
    cout << "!";
    for (int i = 1; i <= n; ++i) {
        cout <<' ' << a[i];
    }
    cout << endl;

    return 0;
}